<!DOCTYPE html>
<html lang="zh-cn">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
	<meta name="description" content="">
	<meta name="author" content="">
	<title>全民狂欢，接猴有奖</title>
	<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/main.css">
	
	<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/myanimate.css">
</head>
<body>
	<!-- loading -->
	<div class="load hide" id="loading">
		<div class="load_box">
			<div class="load-inner"></div>
			<p>loading...</p>
		</div>
	</div>
	<!-- index -->
	<div class="index hide" id="index">
		<div class="logo"><img src="{$_C.hy_path}images/logo.png" alt=""></div>
		<div class="index-top">
			<img src="{$_C.hy_path}images/title.png" alt="" id="title"  class="animated bounceInDown">
			<img src="{$_C.hy_path}images/caishen.png" alt="" id="caishen" class="animated zoomIn delay20">
		</div>
		<div class="index-bottom" >
			<img src="{$_C.hy_path}images/imgbottom.png" alt="">
			<div class="index-btn animated bounceIn delay35" id="btns">
				<p>
					<a class="btn-o" {if $canplay.status eq 1}href="index.php?g=mobile&m=index&a=game"{else}onclick="showToast('{$canplay.msg}');"{/if}><img src="{$_C.hy_path}images/btn1.png" alt=""></a>
				</p>
				<p>
					<a class="btn-g" onclick="show_page('gift')"><img src="{$_C.hy_path}images/btn2.png" alt=""></a>
					<a class="btn-g" onclick="show_page('rank_page')"><img src="{$_C.hy_path}images/btn3.png" alt=""></a>
				</p>
				<p>
					<a class="btn-g" onclick="show_page('rule')"><img src="{$_C.hy_path}images/btn4.png" alt=""></a>
					<a class="btn-g" onclick="show_page('share')"><img src="{$_C.hy_path}images/btn5.png" alt=""></a>
				</p>
			</div>
		</div>
	</div>
	<!-- gift -->
	<div class="gift fixedbg hide" id="gift">
		<div class="gift-alert">
			<img src="{$_C.hy_path}images/gift1.png" alt="" class="resimg">
			<img src="{$_C.hy_path}images/gift2.png" alt="" class="resimg">
			<img src="{$_C.hy_path}images/gift3.png" alt="" class="resimg">
			<img src="{$_C.hy_path}images/gift4.png" alt="" class="resimg">
			<a href="#" onclick="show_page('index')" class="close"></a>
		</div>
	</div>
	<!-- rule -->
	<div class="rule fixedbg hide" id="rule">
		<div class="rule-alert pocenter">
			<img src="{$_C.hy_path}images/rulebg.png" alt="" class="resimg">
			<div class="rule-info">
				<p>30秒内，接住屏幕掉下来小物品，避免接住减分物品，接住的加分物品越多获得分数越高，排名前6名即可 获得相应奖品。每天3次参与机会，分享给1位好友并点击参与活动，视为分享成功1次，参与机会+3，成 功分享数越多，参与机会越多。</p>
				<p>活动时间：2016年1月7日-1月25日23:59</p>
				<p>1、游戏总得分：以用户所玩次数分数累积计算最终总得分；<br/>
					2、物品：加分、减分两类。加分：80猴票、丙申猴票（+15分）、壬申猴票、甲申猴票（+10分），减分 ：爆竹（-5分）；<br/>
					3、分数相同，以用户参与游戏的先后顺序评定最终获奖名单；<br/>
					4、本活动杜绝刷票，发现恶意刷票分数清零。<br/>
					本活动最终解释权归深圳市集邮公司所有</p>
			</div>
			<a href="#" onclick="show_page('index')" class="close"></a>
		</div>
	</div>
	<!-- share -->
	<div class="share fixedbg hide" id="share">
		<img src="{$_C.hy_path}images/share.png" alt="" class="resimg" onclick="show_page('index')">
	</div>
	<!-- rank -->
	<div class="rank fixedbg page" id="rank_page">
		<div class="rank-alert pocenter">
			<img src="{$_C.hy_path}images/rank.png" alt="" class="resimg">
			<div class="rank-list">
			{foreach from=$score.data item=se}
				<div class="rank-item">
					<span class="ranknum">{$se.num}</span>
					<span class="touxiang"><img {if $se.headimgurl}src="{$se.headimgurl}"{else}src="{$_C.hy_path}images/rankpeo.png"{/if} alt="" class="resimg"></span>
					<span class="name">{$se.nickname}</span>
					<span class="fenshu">{$se.allScore}</span>
				</div>
			{/foreach}
			</div>
			<a href="#" class="close" onclick="show_page('index')"></a>
		</div>
	</div>
	
	<script type="text/javascript">
		window.onload=MyAutoRun;
		var state = true;
		var type = "{$type}";
		function MyAutoRun( ){
			loading.style.display = "block";
			
			if(type == 'rank')
			{
				loading.style.display = "none";
				show_page('rank_page');
			}else {
				getid("loading").style.display = "block";
				setTimeout(function(){
					loading.style.display = "none";
					indexPage.style.display = "block";
					if(type == 'start')
					{
						var status = {$canplay.status};
						if(status == 1)
						{
							location.href = "index.php?g=mobile&m=index&a=game";
						}
						else
						{
							var msg = "{$canplay.msg}";
							showToast(msg);
						}
					}
				}, 1500)
			}
		}

		function getid(idname){
			return document.getElementById(idname);
		}

		function addClass(select,show){
			var classname = select.className;
			select.className = classname + ' ' + show;
			setTimeout(function(){
				select.className = classname;
			}, 900)
		}
		

		function hasClass(obj, cls) {  
   		 return obj.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'));  
		}  
  
		  
		function removeClass(obj, cls) {  
		    if (hasClass(obj, cls)) {  
		        var reg = new RegExp('(\\s|^)' + cls + '(\\s|$)');  
		        obj.className = obj.className.replace(reg, ' ');  
		    }  
		}  


		var loading = getid("loading");  //加载
		var indexPage = getid("index");  // 首页
		var giftPage = getid("gift");    //奖品
		var sharePage = getid("share");  //分享
		var rankPage = getid("rank_page");  //排行
		var rulePage = getid("rule");    //规则
		
		var title  = getid("title");
		var caishen  = getid("caishen");
		var btns  = getid("btns");
		var hiddenObj = new Array();
		//var showObj = new Array();
		hiddenObj = [indexPage,giftPage,sharePage,rankPage,rulePage];
		//清除首次进入效果
		function remove_animate()
		{
			removeClass(title,"animated");
			removeClass(caishen,"animated");
			removeClass(btns,"animated");
		}
		//单页面切换
		function show_page(showPage){
			for(var i=0;i<hiddenObj.length;i++)
			{
				hiddenObj[i].style.display = "none";
			}
			var showPage = getid(showPage);
			showPage.style.display = "block";
			addClass(showPage,'opshow');
			remove_animate();
		}
	</script>
	<script type="text/javascript" src="{$_C.hy_path}js/jquery-1.11.2.min.js"></script>
	<script>
		var jsdk = {$jsdk};
		var share = {$shareInfo};
		var is_share = {$config.is_share};
		var share_type = {$config.share_type};
		
	</script>
	<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	<script type="text/javascript" src="{$_C.hy_path}js/wx.js?t=201601062244"></script>
</body>
</html>